using System;
using System.IO;

namespace ExcelTemplateEngine.OpenXML
{
    /// <summary>
    /// 工作簿操作接口
    /// </summary>
    public interface IWorkbookOperations
    {
        /// <summary>
        /// 打开Excel文件
        /// </summary>
        /// <param name="filePath">Excel文件路径</param>
        /// <returns>工作簿对象</returns>
        IWorkbook OpenWorkbook(string filePath);
        
        /// <summary>
        /// 从流打开Excel文件
        /// </summary>
        /// <param name="stream">Excel文件流</param>
        /// <returns>工作簿对象</returns>
        IWorkbook OpenWorkbook(Stream stream);
        
        /// <summary>
        /// 创建新的工作簿
        /// </summary>
        /// <returns>新的工作簿对象</returns>
        IWorkbook CreateWorkbook();
        
        /// <summary>
        /// 保存工作簿到文件
        /// </summary>
        /// <param name="workbook">工作簿对象</param>
        /// <param name="filePath">保存路径</param>
        void SaveWorkbook(IWorkbook workbook, string filePath);
        
        /// <summary>
        /// 保存工作簿到流
        /// </summary>
        /// <param name="workbook">工作簿对象</param>
        /// <param name="stream">目标流</param>
        void SaveWorkbook(IWorkbook workbook, Stream stream);
    }
}